-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow momentum coords in to_Vector*D methods + cleanup #423
feat: allow momentum coords in to_Vector*D methods + cleanup #423
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
==========================================
+ Coverage 82.87% 82.92% +0.05%
==========================================
Files 96 96
Lines 11533 11533
==========================================
+ Hits 9558 9564 +6
+ Misses 1975 1969 -6 ☔ View full report in Codecov by Sentry. |
e16643d
to
4db428e
Compare
6e7b8df
to
b12df12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember the discussion on this and I must have missed the review request.
It's a good extension, though I'm worried about the possibility that a user would pass both z
and pz
to one of these functions (see below).
z: float | None = None, | ||
pz: float | None = None, | ||
theta: float | None = None, | ||
eta: float | None = None, | ||
t: float | None = None, | ||
e: float | None = None, | ||
E: float | None = None, | ||
energy: float | None = None, | ||
tau: float | None = None, | ||
m: float | None = None, | ||
M: float | None = None, | ||
mass: float | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If somebody passes both z
and pz
, or both z
and theta
for that matter, does the function complain? It shouldn't just pick one and use it—providing (possibly) conflicting arguments should be an error, to prevent silent mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! Yes, the functions was checking for multiple generic coordinates, and I've added momentum coordinated to that check too.
Description
Fixes #382
Paves the way for #422 (make the conversions more user-friendly)
cc: @nsmith-, @iasonkrom, @lgray
Checklist
$ pre-commit run --all-files
or$ nox -s lint
)$ pytest
or$ nox -s tests
)$ cd docs; make clean; make html
or$ nox -s docs
)$ pytest --doctest-plus src/vector/
or$ nox -s doctests
)Before Merging